<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List, book.BookBean" %>
<%@page import="java.util.*, common.selectMenu" %>
<%
 	session.setAttribute("stage", "2");
	request.setCharacterEncoding("UTF-8");
%>
<jsp:include page="/share/layout.jsp" flush="true">
    <jsp:param name="title" value="書籍情報変更確認"/>
    <jsp:param name="css" value="book.css"/>
    <jsp:param name="content">
        <jsp:attribute name="value">

<!-- contents start -->

<div id="bookEdit">

<%@ page import="java.sql.*"%>
<%
	BookBean bean = (BookBean)request.getAttribute("bean");

	String publisher = (String)request.getAttribute("publisher");

	String flag_name = "";
	if(bean.isOpenFlag()){

		flag_name = "公開";
	}else{
		flag_name = "非公開";
	}
%>

<%

//  公開・非公開ボタンの表示
	Boolean open_flag = bean.isOpenFlag();
 	String open_flag_1 = "";
 	String open_flag_0 = "";
	if(open_flag){
 		open_flag_1 = "checked=\"checked\"";
 	}else{
 		open_flag_0 = "checked=\"checked\"";
 	}
%>

	<div class="book_img">
		<p><img src="http://192.168.3.190:8080/Books/book_img/<%= bean.getPicture() %>.jpg" width="160px" height="160px" name="picture" /></p>
	</div>

	<form action="/Books/book/UpdateServlet" method="get">

	  	<table class="form_table">

			<tr>
				<th>書籍ID</th>
				<td><%=bean.getId() %><input type="hidden" name="id" value="<%= bean.getId() %>" /></td>
			</tr>
			<tr>
				<th>タイトル</th>
				<td><%=bean.getTitle() %><input type="hidden" name="title" size="40" value="<%=bean.getTitle() %>" /></td>
			</tr>
			<tr>
				<th>著者名</th>
				<td><%=bean.getWriter() %><input type="hidden" name="writer" size="40" value="<%=bean.getWriter() %>" /></td>
			</tr>
			<tr>
				<th>出版者</th>
				<td><%=publisher %><input type="hidden" name="publisher" value="<%=publisher %>" /></td>
			</tr>
			<tr>
				<th>ジャンル</th>
				<td><%=bean.getGenre() %><input type="hidden" name="genre_id" value="<%=bean.getGenreId() %>" /></td>
			</tr>
			<tr>
				<th>ISBNコード</th>
				<td><%=bean.getIsbn() %><input type="hidden" name="isbn" size="40" maxlength="20" value="<%=bean.getIsbn() %>"  /></tr>
			<tr>
				<th>発行年月日</th>
				<td>
				<%= bean.getPublicationDate() %><input type="hidden" name="publication_date" size="10" value="<%= bean.getPublicationDate() %>"  />
				</td>
			<tr>
				<th>書籍公開</th>
				<td><%=flag_name %><input type="hidden" name="open_flag" value="<%=bean.isOpenFlag() %>" /></td>
			</tr>
			<tr>
				<th>内容</th>
				<td><%= bean.getContent() %><input type="hidden" name="content" value="<%= bean.getContent() %>" /></td>
			</tr>

		</table>

		<div id="msg_area">以上の内容に変更しますか？</div>

        <div class="buttons">
  		  <input type="button" value="戻る" class="button" style="cursor:pointer" onClick="history.back(); return false;" title="『書籍情報変更』へ">
  		  <input type="submit" value="変更" class="button" title="『書籍情報検索』へ" style="cursor:pointer">
        </div>

	</form>

</div>

<!-- contents end -->
        </jsp:attribute>
    </jsp:param>
</jsp:include>